####################################################
####       Replication Code for              ####
####  A Re-Assessment of Reporting Bias in   ####
#### Event-Based Violence Data with Respect  ####
####         to Cell Phone Coverage          ####
#################################################
####                                         ####  
####                7/03/2017                ####         
####     this file runs all the rcode        ####  
####    and creates a log file               ####  
#################################################


##set working directory

### note that RandomWindows is separated and run earlier since it is advisable 
### to run this code on a high computing cluster. If not execution may take days/weeks

sink("log_replication_WindowsRandom.txt")
source("RandomWindows.R", echo = T)
sink()


sink("log_replication_cellphones.txt") 
source("(2)_Generate_Parameter_Estimates_Cross_Section.R", echo = TRUE)
source("(3)_Generate_Results_Simulation.R", echo = TRUE)
source("(4)_Generate_Figures_Main_Appendix.R", echo = TRUE)
sink()